  .data
  .align 2
jumptable:
  .word main, case1, case2, case3
prompt:
  .asciiz "\n\n Input a value from 1 to 3:"

  .text
main:
  li    $s0, 32
  li    $v0, 4
  la    $a0, prompt
  syscall
  li     $v0, 5
  syscall
  blez  $v0, main
  li    $t3, 3
  bgt   $v0, $t3, main
  la    $a1, jumptable
  sll   $t0, $v0, 2
  add   $t1, $a1, $t0
  lw    $t2, 0($t1)
  jr    $t2

case1:
  sll   $s0, $s0, 1
  b     output
case2:
  sll   $s0, $s0, 2
  b     output
case3:
  sll   $s0, $s0, 3

output:
  li    $v0, 1
  move  $a0, $s0
  syscall
  li $v0, 10
  syscall
